﻿<%@ Page Language="C#" MasterPageFile="~/MasterPages/common.Master" AutoEventWireup="true" CodeBehind="Post.aspx.cs" Inherits="pcsse.BBS.Post" ValidateRequest="false"%>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="../CSS/bbs.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .style4
        {
            width: 94px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="hoder_sidebar" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="hoder_maincontent" runat="server">
    <asp:SiteMapPath ID="SiteMapPath1" runat="server" SkipLinkText="">
    </asp:SiteMapPath>
    <br />
    <div class="post_title"><asp:Label ID="SubjectLabel" runat="server" Text="Label" Width="500px"></asp:Label></div>
    <asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1" DataKeyNames="ID">
        <ItemTemplate>
        <div class="post_item">
        <div class="txt">
        <%# Eval("TEXT") %>
        </div>
        <br />
        <div style="text-align:right;"><b><%# Eval("STUDENT_ID") %></b>&nbsp;发表于&nbsp;<%# Eval("TIME") %>  </div>
        </div>
            
        </ItemTemplate>
     
        <EmptyDataTemplate>
           
                        未返回数据。
        </EmptyDataTemplate>
      
        <LayoutTemplate>

                            <div ID="itemPlaceholder" runat="server">
                            </div>
        <div style="text-align:right">
                        <asp:DataPager ID="DataPager1" QueryStringField="p" runat="server" PageSize="5" PagedControlID="ListView1">
                            <Fields>
                                <asp:NextPreviousPagerField ButtonType="Link" ShowFirstPageButton="True" 
                                    ShowNextPageButton="False" ShowPreviousPageButton="False" FirstPageText="首页"  />
                                <asp:NumericPagerField />
                                <asp:NextPreviousPagerField ButtonType="Link" ShowLastPageButton="True" 
                                    ShowNextPageButton="False" ShowPreviousPageButton="False" LastPageText="末页" />
                            </Fields>
                        </asp:DataPager>
                        &nbsp;<a href="#" onclick="javascript:history.go(-1)">返回上一级</a>
                        </div>
                   
        </LayoutTemplate>
      
    </asp:ListView>
    <asp:ListView ID="ListView2" runat="server" DataSourceID="SqlDataSource1" DataKeyNames="ID" Visible="False">
        <ItemTemplate>
            <tr >
                <td >
                    <asp:Label ID="STUDENT_IDLabel" runat="server" 
                        Text='<%# Eval("STUDENT_ID") %>' />
                </td>
                <td >
                    <asp:Label ID="TEXTLabel" runat="server" Text='<%# Eval("TEXT") %>' />
                </td>
                
            
            
            
            <td>
                    <asp:Label ID="TIMELabel" runat="server" Text='<%# Eval("TIME") %>' />
            </td>
            <td>
                    <asp:LinkButton ID="LinkButton2" runat="server" CommandName="Delete">删除</asp:LinkButton>
            
                    <asp:Label ID="Label2" runat="server" Text='<%# Eval("ID")+"楼" %>'></asp:Label>
            </td>
            </tr>
            
        </ItemTemplate>
       
        <EmptyDataTemplate>
            <table id="Table1" runat="server" 
                >
                <tr>
                    <td>
                        未返回数据。</td>
                </tr>
            </table>
        </EmptyDataTemplate>
       
        <LayoutTemplate>
            <table id="Table2" runat="server">
                <tr id="Tr1" runat="server">
                    <td id="Td1" runat="server">
                        <table ID="itemPlaceholderContainer" runat="server" border="1" 
                            >
                            <tr id="Tr2" runat="server" >
                                <th id="Th1" runat="server">
                                    学号</th>
                                <th id="Th2" runat="server">
                                    主题</th>
                                    <th id="Th3" runat="server">
                                    发帖时间</th>
                                    <th id="Th4" runat="server">
                                    操作</th>
                                
                            </tr>
                            <tr ID="itemPlaceholder" runat="server">
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr id="Tr3" runat="server">
                    <td id="Td2" runat="server" 
                        >
                        <asp:DataPager ID="DataPager1" QueryStringField="p" runat="server" PageSize="5" PagedControlID="ListView2">
                            <Fields>
                                <asp:NextPreviousPagerField ButtonType="Link" ShowFirstPageButton="True" 
                                    ShowNextPageButton="False" ShowPreviousPageButton="False" FirstPageText="首页"  />
                                <asp:NumericPagerField />
                                <asp:NextPreviousPagerField ButtonType="Link" ShowLastPageButton="True" 
                                    ShowNextPageButton="False" ShowPreviousPageButton="False" LastPageText="末页" />
                            </Fields>
                        </asp:DataPager>
                    </td>
                </tr>
            </table>
        </LayoutTemplate>
       
    </asp:ListView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
       ConnectionString="<%$ ConnectionStrings:PCSSE %>"      
        SelectCommand="SELECT [ID],[STUDENT_ID],[TEXT],[TIME] FROM [T_REPLY] WHERE ([TITLE_ID] = @TITLE_ID) ORDER BY [ID]"
        DeleteCommand="DELETE FROM [T_REPLY] WHERE ([ID]=@ID)">
        <SelectParameters>
            <asp:QueryStringParameter DefaultValue="1" Name="TITLE_ID" 
                QueryStringField="ID" Type="Int32" />
        </SelectParameters>
        <DeleteParameters>
            <asp:Parameter Name="ID" Type="Int32" />
        </DeleteParameters>
    </asp:SqlDataSource>
     <table align="left">
      <tr>
      <td class="style4">
     <asp:Label ID="Label1" runat="server" Text="发表回复" Font-Size="Medium" 
              Font-Bold="True"></asp:Label>
    </td>
    <td>
        </td>
    </tr>
          
              <tr>
                  <td class="style4">
                      内容：</td>
                  <td>
                      <textarea id="textcontent2" cols="100" rows="8" style="width:500px;height:200px;visibility:hidden;" runat="server"></textarea>
                  </td>
              </tr>
          </caption>
          <tr>
          <td class="style4">
              <asp:Button ID="Button1" runat="server" Text="提交" Height="30px" 
                  onclick="Button1_Click" Width="73px" /><br />(提交快捷键: Ctrl + Enter)</td>
          </tr>
    </table>
    
    <br />
    
    <script type="text/javascript" charset="utf-8" src="../kindeditor/kindeditor.js"></script>

		<script type="text/javascript">

			KE.show({

				id : '<%=textcontent2.ClientID %>',

				resizeMode : 1,

				allowPreviewEmoticons : false,

				allowUpload : false,

				items : [

				'fontname', 'fontsize', '|', 'textcolor', 'bgcolor', 'bold', 'italic', 'underline',

				'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',

				'insertunorderedlist', '|', 'emoticons', 'image', 'link']

			});

		</script>
</asp:Content>
